﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UIManager : MonoBehaviour
{
    private static UIManager instance;
    private UIManager() { }
    public static UIManager GetInstance()
    {
        return instance;
    }

    public SettingPanel SettingPanel;
    public GamePanel GamePanel;

    public HelpPanel HelpPanel;
    
    //public SelectCheckPointPanel SelectCheckPointPanel;
    //public StarPanel StarPanel;
    //public LoadingPanel LoadingPanel;
    void Awake()
    {
        instance = this;

        //NotifacitionCenter.GetInstance().registerObserver(NotifyType.END_LOGO, on_END_LOGO);

        //NotifacitionCenter.GetInstance().registerObserver(NotifyType.ENTER_MAP, on_ENTER_MAP);
        //NotifacitionCenter.GetInstance().registerObserver(NotifyType.MAPSCENE_LOAD_COMPLETE, on_MAPSCENE_LOAD_COMPLETE);

        //NotifacitionCenter.GetInstance().registerObserver(NotifyType.ENTER_KITCHEN, on_ENTER_KITCHEN);
        

        
        //NotifacitionCenter.GetInstance().registerObserver(NotifyType.SELECT_CHECKPOINT, OpenSelectCheckPointPanel);

        //HelpPanel.gameObject.SetActive(true);
    }
    
    //public void on_END_LOGO(NotifyEvent e)
    //{
    //    HelpPanel.gameObject.SetActive(false);

    //    SettingPanel.gameObject.SetActive(true);
    //    //SettingPanel.List_Panel[0].SetActive(true);
    //}

    //public void on_ENTER_MAP(NotifyEvent e)
    //{
    //    SettingPanel.gameObject.SetActive(false);
    //}

    //public void on_MAPSCENE_LOAD_COMPLETE(NotifyEvent e)
    //{
    //    StarPanel.gameObject.SetActive(true);
    //    StarPanel.Refresh();
    //}

    //public void on_ENTER_KITCHEN(NotifyEvent e)
    //{
    //    SelectCheckPointPanel.gameObject.SetActive(false);
    //    StarPanel.gameObject.SetActive(false);
    //}

    //public void OpenSelectCheckPointPanel(NotifyEvent e)
    //{
    //    SelectCheckPointPanel.gameObject.SetActive(true);

    //    int index = (int)e.Params["index"];
    //    List<LevelData> map_list = DataManager.GetInstance().m_MapList.map_list;
    //    LevelData levelData = map_list[index - 1];
        
    //    SelectCheckPointPanel.levelData = levelData;
    //    SelectCheckPointPanel.Text_Level.text = "关卡 " + levelData.level1.ToString() + " - " + levelData.level2.ToString();
    //    SelectCheckPointPanel.Text_Score.text = levelData.score.ToString();
    //    SelectCheckPointPanel.Text_StarNumber1.text = levelData.starNumbers[0].ToString();
    //    SelectCheckPointPanel.Text_StarNumber2.text = levelData.starNumbers[1].ToString();
    //    SelectCheckPointPanel.Text_StarNumber3.text = levelData.starNumbers[2].ToString();
        
    //    Sprite sprite = ResourceManager.dictionary_sprite[levelData.screenshot];
    //    SelectCheckPointPanel.Image_Screenshot.sprite = sprite;
    //}
}
